package com.example.thymeleaf1.controller;

import com.example.thymeleaf1.domain.T_article;
import com.example.thymeleaf1.service.T_articleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class LoginController {
    @Autowired
    T_articleService t_articleService;
    @GetMapping("/toLogin")
    public String toLogin(Model model) {
        List<T_article> t_articlesList = t_articleService.getAll();
        model.addAttribute("articles", t_articlesList);
        return "index";
    }
}
